package ds.students;

import ds.interfaces.Stack;

/**
 * @author simont
 *
 */
public class DSStack extends Stack {

	public DSStack() {
		list = new DSList();
	}
	
	public DSStack(DSStack other) {
		list = new DSList(other.list);
	}
	
	@Override
	public Token push(Token obj) {
		list.add(obj);
		return null;
	}

	@Override
	public Token peek() {
		return list.get(list.size()-1);
	}

	@Override
	public Token pop() {
		return list.remove(list.size()-1);
	}

	@Override
	public boolean isEmpty() {
		return list.isEmpty();
	}

	@Override
	public int size() {
		return list.size();
	}
	
	@Override
	public String toString() {
		return list.toString();
	}
}
